<template>
	<view class="shiciBox" :style="{background: 'url('+imageURL+')',backgroundSize:'cover'}">
		<template v-for="(item,index) in shiciList" >
			<ShiItem :itemConetnt="item.content" :key="index" :shiciUrl="item.url"></ShiItem>
		</template>
	</view>
</template>

<script>
	import ShiItem from "@/component/ShiCiitem.vue"
	import {get, showModel,showSuccess} from '@/config/request.js'
	export default{
		data(){
			return {
				imageURL: 'https://i.niupic.com/images/2021/08/01/9pIL.png',
				shiciList:[]
			}
		},
		components:{
			ShiItem
		},
		created(){
			console.log("diyige")
			this.getShici()
		},
		methods:{
			// 获取诗词列表
			async getShici () {
				console.log("第二个")
			  try {
				const res = await get('shiciList',{})
				console.log('后端返回', res)
				this.shiciList=res
			  } catch (err) {
				console.log('从后端返回执行的错误信息是：', err)
				showModel('获取失败', '服务器出了一点问题，请稍后再试~')
			  }
			}
		}
		
	}
</script>

<style lang="less" scoped>
	.shiciBox{
		height: 100%;
		overflow-y: scroll;
	}
</style>
